module Main
	where
	
import IO

main = do 
	{- hSetBuffering stdin LineBuffering -}
	nums <- getNumber
	putStrLn ("Numbers:\t" ++ show nums)
	putStrLn ("Sum:\t" ++ show (sum nums))
	putStrLn ("Product:\t" ++ show (foldr (*) 1 nums))

getNumber = do
	putStrLn "Entre a number or 0 to stop"
	input <- getLine 
	if read input == 0
		then return []
		else do rest <- getNumber
			return ((read input :: Int):rest)
